function dismiss()
{
if (event.keyCode == 13)
{
event.returnValue = false;
applychanges();
}
}

function DialogsJsWindowOnLoad()
{
var o = window.dialogArguments;

templateTitle.value	= o.Title;
templateDesc.value	= o.Description;
languagecode.value = o.LanguageCode;
updateUI();
}

window.attachEvent('onload', DialogsJsWindowOnLoad);

function applychanges()
{
if (templateTitle.value == "")
{
alert(LOCID_KBTED_ENTERARTICLETITLE);
}
else
{
window.returnValue = new TemplateObj(templateTitle.value, templateDesc.value, languagecode.value, 0);
window.close();
}
}

function cancel()
{
window.close();
}

function updateUI()
{
butBegin.disabled = (templateTitle.value.length == 0);
}

function onPaste()
{
butBegin.disabled = window.clipboardData.getData('Text').length == 0;
}
